<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!-- saved from url=(0043)https://1344267101.workxp.info/chances/4555 -->

<HTML>
<HEAD>	
	<META content="IE=9.0000" http-equiv="X-UA-Compatible">

	<META content="text/html; charset=utf-8" http-equiv="Content-Type">
	<META name="viewport" content="width=device-width, initial-scale=1.0">
	<TITLE>crm</TITLE>
	<!--[if lt IE 9]>
	  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
  <![endif]--><!--[if IE]>
<SCRIPT type="text/javascript" charset="utf-8">
			window.onload = function() {
				$('input, textarea').placeholder();
			}
		</SCRIPT>
<![endif]--><LINK rel="stylesheet" type="text/css" href="../css/application-766336123a9b61bedf26182718c02860.css" media="all">

<SCRIPT type="text/javascript" src="../js/application-e8369d8531953caeeedd0118548cdc1c.js"></SCRIPT>

<META name="csrf-param" content="authenticity_token">
<META name="csrf-token" content="A7MYZr3YBNzKg3DFK51+1h8CS61+jrSSeayP+fYwLQw=">
<STYLE type="text/css" media="screen">
	table.involvements tr td {
		vertical-align:middle;
		padding: 2px 0;
	}
	table.involvements td.avatar {
		width: 40px;
	}
	table.involvements td.actions {
		text-align:right;
	}
</STYLE>

<STYLE type="text/css" media="screen">
	div.select_access_policy .scope {
		margin:2px 0;
	}
	div.select_access_policy .scope .editor {
		display:none;
	}
	div.select_access_policy .activated .editor {
		display:block;
		margin:2px 15px;
	}
	div.select_access_policy .hide {
		display:none;
	}
</STYLE>

<STYLE type="text/css" media="screen">
	div.new_note_form_basics div.right {
		float: right;
	}
	div.options{
		border-bottom: 1px dashed #CCCCCC;
		padding-bottom: 5px;
		margin-bottom:10px;
	}
	div#email_note_container{
		margin-bottom: 10px;
	}
	.subscribers {
	    list-style: none outside none;
	    margin-left: 0;
	    overflow: hidden;
	}
	.subscribers li {
	    float: left;
	    width: 150px;
	}
</STYLE>

<SCRIPT type="text/javascript" charset="utf-8">
		$(document).ready(function() {
			$('#search').marcoPolo({
			  url: '/search',
			  formatItem: function (data, $item) {
			    return data.icon + data.name;
			  },
			  onSelect: function (data, $item) {
					if (data.url != '#') {
						$('#search').val(data.name);
				    window.location = data.url;
					}
			  }
			});
			
			validate_form('#task_form', true)
			
			$('a.zoom').fancyZoom({scaleImg: true, closeOnClick: true})
			
			$('#search-link').data('tooltip').options.placement = 'bottom';
		});
		
		$(document).scroll(function(){
	    if ($('.back-top').attr('data-top') <= $(this).scrollTop())
        $('.back-top').removeClass('hide');
	    else
        $('.back-top').addClass('hide');
		});
		
	</SCRIPT>

<META name="GENERATOR" content="MSHTML 9.00.8112.16447">
</HEAD>

<BODY class="crm">
 <body class="crm">
    <div class="navbar navbar-fixed-top">
  	<div class="navbar-inner">
	  	<div class="container-fluid">
				<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</a>
				<a class="brand" href="home.action/"><img alt="Workxp-logo" src="../img/workxp-logo-68b281b82e899ff436ecf42ebcc1bc58.png"></a>
				<div class="nav-collapse">
		  		<ul class="nav">
						<li class="divider-vertical"></li>
						<li class=""><a href="../main.action">最新动态</a></li>
						<li class=""><a href="../contact/list.action">联系人</a></li>
						<li class=""><a href="../task/task.action">任务</a></li>
						
						<li class="active"><a href="list.action">机会</a></li>
			    </ul>
					
					<ul class="nav">
					  <li class="dropdown">
							<a href="https://1344267101.workxp.info/people/new#" class="dropdown-toggle" data-toggle="dropdown">
						    添加
						    <span class="caret"></span>
						  </a>
						  <ul class="dropdown-menu new-actions">
						    <li><a href="../contact/addcontact.action"><i class="icon-person"></i> 联系人</a></li>
								<li><a href="../contact/addcompany.action"><i class="icon-company"></i> 公司</a></li>
								<li class="divider"></li>
								<li><a href="..task/addtask.action"><i class="icon-ok"></i> 任务</a></li>
								<li><a href="../deal/adddeal.action"><i class="icon-dollar"></i> 机会</a></li>
						  </ul>
						</li>
					</ul>
					<ul class="nav">
						<li class="divider-vertical"></li>
					</ul>
					<form class="navbar-search">
						<input type="text" name="search" id="search" class="search-query mp_input" placeholder="搜索联系人或机会" autocomplete="off" x-webkit-speech="" style="height:30px;"><ul class="typeahead dropdown-menu mp_list" style="display: none; "></ul>
			    </form>
					
					<ul class="nav">
						<li><a href="https://1344267101.workxp.info/notes/search" rel="tooltip" id="search-link" data-original-title="搜索事件"><i class="icon-cog"></i></a></li>
					</ul>
			
					<ul class="nav pull-right">
						<li class=""><a href="https://1344267101.workxp.info/profiles">${sessionScope.user.username }</a></li>
						
								<li class="dropdown">
									<a data-toggle="dropdown" class="dropdown-toggle" href="https://1344267101.workxp.info/people/new#">管理 <b class="caret"></b></a>
									<ul class="dropdown-menu settings">
										<li><a href="https://1344267101.workxp.info/product_users"><i class="icon-user"></i> 同事</a></li>
										<li><a href="https://1344267101.workxp.info/groups"><i class="icon-group"></i> 组</a></li>
										<li class="divider"></li>
										<li><a href="https://1344267101.workxp.info/settings"><i class="icon-cog"></i> 帐号</a></li>
									</ul>
								</li>
						
						<li class="divider-vertical"></li>
						<li class=""><a href="../logout.action">退出</a></li>
			    </ul>
				</div>
		  </div>
	  </div>
  </div>

<DIV class="container-fluid">
<DIV class="row-fluid">
<DIV class="span8">
<DIV class="well screen">
<DIV class="page-header header">
<TABLE style="width: 100%;">
  <TBODY>
  <TR>
    <TD style="vertical-align: top;" width="68"><SPAN class="icon-larget-dollar"></SPAN></TD>
    <TD>
      <DIV class="right-links">由 <STRONG>${deals.user.username }</STRONG> 添加 |					
      	<A title="删除机会"  href="deleteDeal.action?id=${deals.id }" rel="tooltip"><I  class="icon icon-edit">delete</I></A>
      </DIV>	${deals.title }								
      <DIV style="font-size: 14px;" class="details">						￥ ${deals.money }					</DIV>
      <DIV class="btn-group state-switcher" data-toggle="buttons-radio">
      <BUTTON class="btn pending" data-loading-text="处理中.." state="pending">跟踪</BUTTON>
      <BUTTON class="btn success" data-loading-text="处理中.."  state="won">成功</BUTTON>
      <BUTTON class="btn important" data-loading-text="处理中.." state="lost">失败</BUTTON>
      </DIV>
      </TD>
      </TR>
      </TBODY>
      </TABLE>
      </DIV>
<DIV id="parties_loading" class="live_search_spinner" behavior="spinner">
<DIV class="liner">
<H3>处理中...</H3><IMG alt="WorkXP" src="../img/indicator.gif"></DIV></DIV>
<DIV id="main" class="main">
<DIV>
<FORM id="note-form" class="simple_form new_note" accept-charset="UTF-8" method="post" action="saveDealNote.action?id=${deals.id }">
	<%-- novalidate="novalidate" data-remote="true"--%>

<DIV class="control-group text required">
<DIV class="controls">
<TEXTAREA id="note_content" class="text required content" cols="40" rows="20" name="dealNote.content">
</TEXTAREA>

</DIV>
</DIV>
<div class="new_note_form_basics">
			<div class="submit right">
			 <input class="btn btn-primary" data-loading-text="处理中.." name="commit" type="submit" value="保存" x-webkit-speech=""> 
				
			</div>
			
		</div>
</FORM>
</DIV>
<%--

		<c:if test="${dealNoteList!=null }"></c:if>
 --%>
 <c:forEach items="${dealNoteList}" var="dealnotelist"> 
<TABLE style="margin-bottom: 60px;" id="activities" class="table crm-table top no-hover">
  <TBODY>
  <TR id="note-817320" class="note" data="817320" data-from="Chance">
    <TD class="icon"><SPAN class="sprite note"></SPAN></TD>
    <TD>
      <DIV class="note-header">
      <DIV style="float: right;">
      <UL class="nav nav-pills">
        <LI><A href="https://1344267101.workxp.info/notes/817320">评论</A></LI>
       
        <LI><A title="编辑" href="https://1344267101.workxp.info/notes/817320/edit?from=Chance">编辑</A></LI>
        <LI><A title="删除" href="deleteNote.action?id=${dealnotelist.id }">删除</A></LI>
        </UL>
        </DIV>
        
       
      
      <DIV class="subject"><SPAN class="label label-warning">${dealnotelist.createtime }</SPAN></DIV>
       <DIV class="content">
      <P> ${dealnotelist.content }</P>
 
      </DIV>
      <DIV class="meta">由  ${user.username } 添加		</DIV>
      
  
      <DIV class="meta"></DIV>
      
      </DIV>
     
      </TD>
      </TR>
      </TBODY>
</TABLE>
  </c:forEach>

<STYLE>
.meta {
	line-height: 26px;
}
.meta li span {
	padding: 4px 8px;
	font-weight:blod;
}
.meta	.nav-pills li a {
  padding: 4px 8px;
}
.meta .nav {
	margin-bottom: 0px;
}
</STYLE>

<SCRIPT>
	$(document).ready(function() {
		bind_regarding_event()
	});
</SCRIPT>

<SCRIPT type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		$('.btn.pending').addClass('active');
		$.each($('.state-switcher .btn'), function(index, item) {
			$(item).live('click', function(event) {
				if($(item).hasClass('active')) return false;
				if(confirm('确定要改变机会状态为' + $(item).text() + '?')) {
					$(item).button('loading')
					$.ajax({
						type: 'PUT',
						url: '/chances/4555/set_state?state=' + $(item).attr('state'), 
						success: function(data) {
							$(item).button('reset')
						}
					})
				} else {
					return false;
				}
			})
		})
		$.get('/tasks/target?target_type=Chance&target_id=4555', function(data) {
			$('#tasks_div').html(data);
		}, 'html')
	})
</SCRIPT>
</DIV>
</DIV>
	<div class="nav pull-right"><a href="list.action">返回机会列表</a></div>
</DIV>
<DIV class="span4 sidebar">
<DIV id="tasks_div" class="well">
<div class="title">任务列表</div>

<a href="../task/addtask.action"> 添加一个任务</a>

</DIV>
<DIV class="well">
<DIV id="background_container">
<DIV class="title"><SPAN><A onclick="toggle_edit_background_info(true); return false;" 
href="https://1344267101.workxp.info/chances/4555#">编辑</A></SPAN>  		背景信息  
	</DIV>
	<DIV id="background_info">
		<P>${deals.content }</P>
	</DIV>
</DIV>

<DIV style="display: none;" id="edit_background_container">
<FORM id="background_for m"method="post" action="editDeal.action?id=${deals.id}" >

<DIV class="control-group text optional">
<LABEL class="text optional control-label" for="contact_others"> 修改背景信息</LABEL>
<DIV class="controls">
<TEXTAREA id="description" class="content" name="editcontent" required="required">${deals.content}</TEXTAREA>
</DIV>
</DIV>
<DIV class="submit">
<input class="btn btn-primary" data-loading-text="处理中.." name="commit" type="submit" value="保存" x-webkit-speech=""> 
<A class="btn" onclick="toggle_edit_background_info(); return false;" href="https://1344267101.workxp.info/chances/4555#">取消</A></DIV>
</FORM></DIV></DIV>
<SCRIPT type="text/javascript" charset="utf-8">$(document).ready(function() {
		validate_form("#background_form", true)
	});
	function toggle_edit_background_info(edit) {
		$('#background_container').toggle()
		$('#edit_background_container').toggle()
		if (edit) $('#description').focus()
	}
</SCRIPT>

<DIV id="show_contacts_in_collection" class="well">
<DIV class="title"><SPAN><A onclick="manage_contacts(true); return false;" href="https://1344267101.workxp.info/chances/4555#">添加/删除</A></SPAN>
		相关联系人	</DIV>
<TABLE class="table crm-table involvements"></TABLE></DIV>
<DIV style="display: none;" id="manage_contacts_in_collection" class="well">
<DIV class="title">添加联系人		<SPAN><A onclick="manage_contacts(false); return false;" 
href="https://1344267101.workxp.info/chances/4555#">完成</A></SPAN></DIV>
<DIV style="padding-top: 5px; position: relative;">
<DIV class="marco_polo_container"><INPUT id="candidates" name="candidates" type="text" 
placeholder="通过搜索联系人添加"><IMG style="width: 21px; height: 5px; vertical-align: middle; display: none;" 
id="candidates-indicator" class="spinner" alt="Indicator" src="机会_files/indicator-57b9a4bc69531739d1aefa7c33cdcd08.gif"></DIV></DIV>
<H4 style="margin: 8px 0px 5px; font-weight: normal;">已关联的联系人</H4>
<TABLE class="table crm-table involvements"></TABLE></DIV>
<SCRIPT type="text/javascript" charset="utf-8">
	function manage_contacts(edit){
		$('#show_contacts_in_collection').toggle();
		$('#manage_contacts_in_collection').toggle();
		if (edit) $('#candidates').focus()
	}
	
	$(document).ready(function() {
		ContactQuickShow.init();
		
		$('#candidates').marcoPolo({
		  url: '/contacts/auto_complete_for_contact_name',
		  formatItem: function (data, $item) {
		    var ns = data.icon + data.name;
				if(data.company) ns = ns + ' [' + data.company + ']';
				return ns;
		  },
		  onSelect: function (data, $item) {
				$('#candidates').val(data.name)
				$('#candidates-indicator').show();
				$.post("/involvements", {"target_type": "Chance", "target_id": 4555, "id": data.id});

		  },
			formatNoResults: function(q, $item) {
				return '';
			}
		});
	});
</SCRIPT>
</DIV></DIV></DIV>

<DIV class="back-top hide" data-top="400"><A href="https://1344267101.workxp.info/chances/4555#">返回顶部</A></DIV>
<SCRIPT type="text/javascript">var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-8052682-4']);
  _gaq.push(['_setDomainName', '.workxp.info']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
	
</SCRIPT>
</BODY></HTML>
